package ModelLayer;

import ControlLayer.HelperMethods;
import DBLayer.MapName;

/**
 *
 * @author Evil
 */
public class Employee extends Role //implements Cloneable
{
    @MapName(ColumnName = "ID")
    private int employeeID;
    @MapName(ColumnName = "Salary")
    private int salary;
    @MapName(ColumnName = "Password")
    private String password;
    @MapName(ColumnName = "Username")
    private String username;

    public Employee()
    {
        super();
    }

//    @Override
//    public Employee clone()
//    {
//        Employee obj = new Employee();
//        obj.setEmployeeID(this.employeeID);
//        obj.setPasswordHash(this.password);
//        obj.setSalary(this.salary);
//        obj.setUsername(this.username);
//
//        return obj;
//    }

    /**
     * Get the value of employeeID
     *
     * @return the value of employeeID
     */
    public int getEmployeeID()
    {
        return employeeID;
    }

    /**
     * Set the value of employeeID
     *
     * @param employeeID new value of employeeID
     */
    private void setEmployeeID(int employeeID)
    {
        this.employeeID = employeeID;
    }

    /**
     * Get the value of username
     *
     * @return the value of username
     */
    public String getUsername()
    {
        return username;
    }

    /**
     * Set the value of username
     *
     * @param username new value of username
     */
    public void setUsername(String username)
    {
        this.username = username;
    }

    /**
     * Get the value of password
     *
     * @return the value of password
     */
    public String getPassword()
    {
        return password;
    }

    /**
     * Set the value of password
     *
     * @param password new password hash
     */
    public void setPasswordHash(String passwordHash)
    {
        this.password = passwordHash;
    }

    /**
     * Set the value of password
     *
     * @param password new password in cleartext
     */
    public void setPassword(String password)
    {
        HelperMethods helper = new HelperMethods();
        this.password = helper.MD5Hash(password);
    }

    /**
     * Get the value of salary
     *
     * @return the value of salary
     */
    public int getSalary()
    {
        return salary;
    }

    /**
     * Set the value of salary
     *
     * @param salary new value of salary
     */
    public void setSalary(int salary)
    {
        this.salary = salary;
    }
}
